import Vue from 'vue'
import vuex from 'vuex'
import navMenu from './modules/navMenu'
Vue.use(vuex)

let Store = {
  modules: {
    navMenu,
  },
}

// let modules = Store.modules
// sessionStorage.setItem('init', JSON.stringify(modules))

// for (let i in modules) {
//   if (!modules[i].mutations) {
//     modules[i].mutations = {}
//   }
//   modules[i].mutations['resetStore'] = (state) => {
//     const init = JSON.parse(sessionStorage.getItem('init'))
//     const initState = init[i].state
//     for (let key in initState) {
//       state[key] = initState[key]
//     }
//   }
// }

export default new vuex.Store(Store)
